Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

219
Visualizações
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/types/single-spa-layout-interface' is not defined by "exports" in

Getting following error when run application:

Typescript version - "typescript": "4.7.2"

in package.json

"single-spa": "^5.9.3",
"single-spa-layout": "^2.0.1",
"single-spa-web-server-utils": "^2.3.1",

node version 16.13.0

import {
    constructServerLayout,
    sendLayoutHTTPResponse,
} from "single-spa-layout/dist/types/single-spa-layout-server";
 Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/types/single-spa-layout-interface' is not defined by "exports" in C:\app1\node_modules\single-spa-la
    yout\package.json
        at new NodeError (node:internal/errors:371:5)
        at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
        at packageExportsResolve (node:internal/modules/esm/resolve:692:3)
        at resolveExports (node:internal/modules/cjs/loader:482:36)
        at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
        at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
        at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (C:\app1\node_modules\@cspotcode\source-map-suppo
    rt\source-map-support.js:811:30)
        at Function.Module._load (node:internal/modules/cjs/loader:778:27)
        at Module.require (node:internal/modules/cjs/loader:1005:19)
        at require (node:internal/modules/cjs/helpers:102:18) {
      code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

single-spa-layout has not declared that file to be importable.

The package.json lists the two possible paths:

  "exports": {
    ".": {
      "default": {
        "import": "./dist/esm/single-spa-layout.min.js",
        "require": "./dist/umd/single-spa-layout.min.cjs"
      }
    },
    "./server": {
      "node": {
        "import": "./dist/esm/single-spa-layout-server.min.js",
        "require": "./dist/umd/single-spa-layout-server.min.cjs"
      }
    }
  },

Instead of the import statement you are currently using, use:

import {
    constructServerLayout,
    sendLayoutHTTPResponse,
} from "single-spa-layout/server";
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda